package com.lagou.controller;

import com.lagou.dao.ResumeDao;
import com.lagou.pojo.Resume;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("demo")
public class DemoController {
    @Autowired
    private ResumeDao resumeDao;

    @RequestMapping("/result")
    /*public String result(){
        return "result";
    }*/
    @ResponseBody
    public ModelAndView queryList(){
        ModelAndView modelAndView = new ModelAndView();
        List<Resume> resumeList = resumeDao.queryResumeList();;
        modelAndView.addObject("list",resumeList);
        modelAndView.setViewName("result");
        return modelAndView;
    }
}
